﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <SolidColorBrush x:Key="ApplicationAccentBrush" x:Name="ApplicationAccentBrush" Color="#0079cb"/>
    <SolidColorBrush x:Key="ApplicationAccentBrushSecondary" x:Name="ApplicationAccentBrushSecondary" Color="#1D98EB"/>

    <Color x:Key="ApplicationAccentBrushColour" A="#FF" R="#00" G="#79" B="#cb" />
    <Color x:Key="ApplicationAccentBrushColourSecondary" A="#FF" R="#1D" G="#98" B="#EB" />

    <Style x:Key="CheckBoxFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle 
            Margin="15,0,0,0"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style  x:Key="{x:Type CheckBox}" TargetType="CheckBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FontFamily" Value="{DynamicResource MetroFontRegular}"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource CheckBoxFocusVisual}"/>
        <Setter Property="Foreground" Value="#999999"/>
        <Setter Property="Background" Value="#3f3f3f"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Border x:Name="Border"  
                              Width="13" 
                              Height="13" 
                              CornerRadius="0" 
                              Background="#3f3f3f"
                              BorderBrush="#999999"
                              BorderThickness="1">
                                <Path 
                                                    Width="7" Height="7" 
                                                    x:Name="CheckMark"
                                                    SnapsToDevicePixels="False" 
                                                    Stroke="#979797"
                                                    StrokeThickness="2"
                                                    Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                            </Border>
                        </BulletDecorator.Bullet>
                        <ContentPresenter Margin="8,0,0,0"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Left"
                            RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#454545" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ApplicationAccentBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#c1c1c1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="6,2"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="MinWidth" Value="5"/>
        <Setter Property="MinHeight" Value="5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Label x:Name="root" FontSize="26.67">
                        <ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" RecognizesAccessKey="True"/>
                    </Label>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Foreground" TargetName="root">
                                <Setter.Value>
                                    <!--<SolidColorBrush Color="{DynamicResource AccentColor}"/>-->
                                    <SolidColorBrush Color="DeepSkyBlue"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter Property="Foreground" TargetName="root">
                                <Setter.Value>
                                    <!--<SolidColorBrush Color="{DynamicResource AccentColor}"/>-->
                                    <SolidColorBrush Color="White"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsMouseOver" SourceName="root" Value="True">
                            <Setter Property="Foreground" TargetName="root" Value="GreenYellow"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataGridTemplateColumn x:Key="ButtonTemplateColumn" MinWidth="100" Header="Check">
        <DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
                <Button Name="ButInColumn">Check</Button>
            </DataTemplate>
        </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>

    <Style x:Key="MenuItemStyle1" TargetType="{x:Type MenuItem}">
        <Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type Menu}}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Border x:Name="Border" BorderBrush="Transparent" BorderThickness="1" Background="Transparent" SnapsToDevicePixels="False">
                        <Grid x:Name="Grid">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="Col0" MinWidth="0" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
                                <ColumnDefinition SharedSizeGroup="MenuTextColumnGroup" Width="Auto"/>
                                <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
                                <ColumnDefinition x:Name="Col3" Width="14"/>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter x:Name="Icon" Content="{TemplateBinding Icon}" Grid.Column="0" ContentSource="Icon" VerticalAlignment="Center"/>
                            <ContentPresenter x:Name="HeaderHost" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.Column="1" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="Center"/>
                            <ContentPresenter x:Name="IGTHost" Content="{TemplateBinding InputGestureText}" Grid.Column="2" ContentSource="InputGestureText" Margin="8,1" VerticalAlignment="Center"/>
                            <Grid x:Name="ArrowPanel" Grid.Column="3" Margin="4,0,6,0" VerticalAlignment="Center">
                                <Path x:Name="ArrowPanelPath" Data="M0,0L0,8 4,4z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Right" VerticalAlignment="Center"/>
                            </Grid>
                            <Popup x:Name="SubMenuPopup" AllowsTransparency="True" Focusable="False" HorizontalOffset="-1" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" Placement="Right">
                                <Grid Margin="0,0,5,5">
                                    <Border x:Name="SubMenuBorder" BorderBrush="#FF333337" BorderThickness="1" Background="#FF1B1B1C" SnapsToDevicePixels="True">
                                        <Border.Effect>
                                            <DropShadowEffect Color="Black" ShadowDepth="2"/>
                                        </Border.Effect>
                                        <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True" Margin="2">
                                            <StackPanel KeyboardNavigation.DirectionalNavigation="Cycle" IsItemsHost="True"/>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="TransitionBorder" BorderBrush="#FF1B1B1C" BorderThickness="1" Background="#FF1B1B1C" HorizontalAlignment="Left" Height="2" Margin="1,0,0,0" SnapsToDevicePixels="False" VerticalAlignment="Top" Width="0"/>
                                </Grid>
                            </Popup>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Role" Value="TopLevelHeader">
                            <Setter Property="Padding" Value="6,0,6,2"/>
                            <Setter Property="Placement" TargetName="SubMenuPopup" Value="Bottom"/>
                            <Setter Property="MinWidth" TargetName="Col0" Value="0"/>
                            <Setter Property="Width" TargetName="Col3" Value="Auto"/>
                            <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="IGTHost" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="ArrowPanel" Value="Collapsed"/>
                            <Setter Property="BorderThickness" TargetName="SubMenuBorder" Value="1"/>
                            <Setter Property="Margin" TargetName="SubMenu" Value="2,3,2,2"/>
                            <Setter Property="Width" TargetName="TransitionBorder" Value="{Binding ActualWidth, ElementName=Grid}"/>
                        </Trigger>
                        <Trigger Property="Role" Value="TopLevelItem">
                            <Setter Property="Padding" Value="6,0,6,2"/>
                            <Setter Property="MinWidth" TargetName="Col0" Value="0"/>
                            <Setter Property="Width" TargetName="Col3" Value="Auto"/>
                            <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="IGTHost" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="ArrowPanel" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Role" Value="SubmenuHeader">
                            <Setter Property="DockPanel.Dock" Value="Top"/>
                            <Setter Property="Padding" Value="10,3,0,3"/>
                            <Setter Property="MinHeight" TargetName="Border" Value="22"/>
                            <Setter Property="Background" TargetName="Border" Value="#FF1B1B1C"/>
                        </Trigger>
                        <Trigger Property="Role" Value="SubmenuItem">
                            <Setter Property="DockPanel.Dock" Value="Top"/>
                            <Setter Property="Padding" Value="10,3,0,3"/>
                            <Setter Property="MinHeight" TargetName="Border" Value="22"/>
                            <Setter Property="Visibility" TargetName="ArrowPanel" Value="Collapsed"/>
                            <Setter Property="Background" TargetName="Border" Value="#FF1B1B1C"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsHighlighted" Value="True"/>
                                <Condition Property="Role" Value="TopLevelHeader"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Border" Value="#FF3E3E40"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsHighlighted" Value="True"/>
                                <Condition Property="Role" Value="TopLevelItem"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Border" Value="#FF3E3E40"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsHighlighted" Value="True"/>
                                <Condition Property="Role" Value="SubmenuHeader"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Border" Value="#FF333334"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsHighlighted" Value="True"/>
                                <Condition Property="Role" Value="SubmenuItem"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Border" Value="#FF333334"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSubmenuOpen" Value="True"/>
                                <Condition Property="Role" Value="TopLevelHeader"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Border" Value="#FF1B1B1C"/>
                            <Setter Property="BorderBrush" TargetName="Border" Value="#FF333337"/>
                            <Setter Property="BorderThickness" TargetName="Border" Value="1,1,1,0"/>
                        </MultiTrigger>
                        <Trigger Property="IsSubmenuOpen" Value="True">
                            <Setter Property="Fill" TargetName="ArrowPanelPath" Value="#FF007ACC"/>
                        </Trigger>
                        <Trigger Property="IsSuspendingPopupAnimation" Value="True">
                            <Setter Property="PopupAnimation" TargetName="SubMenuPopup" Value="None"/>
                        </Trigger>
                        <Trigger Property="Icon" Value="{x:Null}">
                            <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="#FF656565"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="MenuControlTemplate1" TargetType="{x:Type ContextMenu}">
        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
        </Border>
    </ControlTemplate>

</ResourceDictionary>